<script type="text/javascript" src="<?=userassets?>core_js/pay_pass.js"></script>
<body>
    <?=pay_passtemplate()?>
    <?php if ($my == "list") : ?>
<div class="container-fluid p-t-15">
        <div class="row">
            <div class="col-lg-12">
              <div class="card">
                  <div class="card-body"> 
                  <div class="list-group-item reed"><marquee scrollamount="<?=$conf['gggdsd']?>" direction="left" align="Middle" style="font-weight: bold;line-height: 20px;font-size: 20px;color: #FF0000;" onmouseover="stop();" onmouseout="start();"> <?=$conf['erweimagg']?></marquee></div>
                  <b class="btn btn-sm btn-default">正常:
                  <b class="btn btn-sm btn-default">支付宝:<a style="color: blue;"><?=$cookie_ok_counts['alipay']?></a>个</b>
                  <b class="btn btn-sm btn-default">微  信:<a style="color: blue;"><?=$cookie_ok_counts['wxpay']?></a>个</b>
                  <b class="btn btn-sm btn-default">QQ钱包:<a style="color: blue;"><?=$cookie_ok_counts['qqpay']?></a>个</b></b>
                  <br>	
                  <b class="btn btn-sm btn-default">失效:
                  <b class="btn btn-sm btn-default">支付宝:<a style="color: red;"><?=$cookie_no_counts['alipay']?></a>个</b>
                  <b class="btn btn-sm btn-default">微  信:<a style="color: red;"><?=$cookie_no_counts['wxpay']?></a>个</b>
                  <b class="btn btn-sm btn-default">QQ钱包:<a style="color: red;"><?=$cookie_no_counts['qqpay']?></a>个</b>	</b>
                  <br>   
                </div>
                <div class="form-group mb-2"> 
                   <div class="text-right">
                     <button class="btn btn-success btn-round"><i class="mdi mdi-bolnisi-cross"></i> <?php echo $con;?></button>
                     <button class="btn btn-primary btn-round" data-toggle="modal" href="#modalHeaderColorInfotoken" data-target="#modalHeaderColorInfotoken" data-id="modalHeaderColorInfotoken">获取通讯token</button>
                     <button data-toggle="modal"  class="btn btn-info btn-round" href="#modalHeaderColorInfo" data-target="#modalHeaderColorInfo" data-id="modalHeaderColorInfo"><i class="fa fa-plus"></i> 新增通道 (当前：<a style="color: blue;"><?=$numrow?></a>/最大：<a style="color: blue;"><?=$conf['qr_nums']?$conf['qr_nums']:$userrow['qr_nums']?></a>)</button>
                    </div>
                </div>
                <div class="table-responsive">
                <table class="table table-bordered">
                     <thead>
					<tr>
						<th>#</th>
						<th>数据</th>
						<th>更新时间/运行时间</th>
						</tr>
						</thead>
				<tbody>
				    <?php 
					    foreach ($result as $res){
					        $rowData = [
					             ['label' => '<a href="javascript:;" onclick="showQrlist(\''.$res['id'].'\');" title="点击查看详情">'.$res['id'].'</a>'],
					             ['label'=>generateQRListItem($res)],
					             ['label'=>generateTableCell($res)]
					            ];
					         $html .= Splicing_form($rowData);   
					    }
					    
					    echo $html;
					    table_page($page,$pages,'Pc_Qrlist')
					?>
                 </div>
<?php endif; ?>	
<?php if ($my == "edit") : ?>
    <div class="container-fluid p-t-15">
    <div class="row">
        <div class="col-md-12">
            <div class="card">
            <div class="card-body">  
             <input type="hidden" class="form-control" id="id" value="<?=$row['id']?>" >
            <div class="form-group">
                <label>二维码备注:</label><br>
                <input type="text" class="form-control" id="beizhu" value="<?=$row['beizhu']?>" >
            </div>
            <div class="form-group">
                <label>CK状态:</label><br>
                <input type="text" class="form-control" value="<?=$ckstatus?>" readonly="readonly" placeholder="若为空则CK已失效，请勿强制开启收款.">
            </div>
            <div class="form-group">
                <label>二维码状态:</label><br>
                <select class="form-control" id="status" default="">
                    <option value="1" <?= $row['status'] == '1' ? "selected" : "" ?>>开启</option>
                    <option value="0" <?= $row['status'] == '0' ? "selected" : "" ?>>关闭</option>
                 </select>  
              </div> 
            <div class="form-group">
                  <label>轮训顺序:</label><br>
                   <input class="form-control" type="number" id="nums" name="nums" value="<?=$row['nums'];?>" min="0" max="10">
                  <b>数字小的优先 默认0</b>
            </div>
             <div class="form-group">
                 <label>风控监控开关:</label><br>
                 <select class="form-control" id="stat"  default="">
                     <option value="1" <?= $row['stat'] == '1' ? "selected" : "" ?>>开启</option>
                     <option value="0" <?= ($row['stat'] == '0' || !$row['stat']) ? "selected" : "" ?>>关闭</option>
                 </select>
             </div>  
             <button type="sumbit" class="btn btn-primary btn-block" onclick="edit_Qr();">确认以上并修改</button>	
<?php endif; ?>	
<div class="modal fade bs-example-modal-center" id="modalHeaderColorInfo" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true">
    <div class="modal-dialog modal-dialog-centered">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title" id="exampleModalLabel">添加二维码</h5>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <div class="modal-body">
                <div class="form-group">
                     <label>挂机类型(选择好类型再上传二维码):</label>
                    <select class="form-control" name="type" id="type">
                        <option value="">请选择要添加的通道</option>
                        <option value="alipay">支付宝APP挂机</option>
                        <option value="wxpay">微信APP挂机</option>
                    </select>
                </div>
               
                <div class="form-group">
                    <label for="imgfile">选择二维码(剪切好边框再上传哦):</label><span class="glyphicon glyphicon-qrcode"></span>
                    <input type="file" class="form-control-file" id="imgfile" accept="image/*" multiple>
                </div>
                <div class="form-group">
                    <label for="qr_url">二维码地址:</label><br>
                    <input type="text" class="form-control" id="qr_url" value="" placeholder="上传二维码自动识别,可修改" name="qr_url">
                </div>
                <div class="form-group">
                    <label id="beizhu_name">备注:</label><br>
                    <input type="text" class="form-control" id="beizhu" value="" placeholder="" name="beizhu">
                </div>
                <div class="form-group">
                <label id="LoginQrcode_msg">确保所有信息填写正确哦</label><br><div id="LoginQrcode">
                </div>
                 <a id="Wx_Sumbit"></br><button type="sumbit" class="btn btn-primary btn-block" onclick="Add_APPQR();">确认以上并添加</button></a>	
                </div>
            </div>
        </div>
    </div>
</div>
<div class="modal fade bs-example-modal-center" id="modalHeaderColorInfotoken" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel1" aria-hidden="true">
    <div class="modal-dialog modal-dialog-centered">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title" id="">App通讯token</h5>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <div class="modal-body">
                <div class="form-group">
                    
                 <textarea class="form-control" name="erweimagg" rows="5" placeholder="token"><?php echo $token?></textarea>
                </div>
                
                <div class="form-group">
                    
                    <img src="https://auth.daoh.top/api/?url=<?=$tokenqr?>"/>
                </div>
            </div>
        </div>
    </div>
</div>
<script src="<?=userassets?>core_js/Del_Qr.js"></script>
<script src="<?=pluginsassets?>js/APP_Qrlist.js"></script>